package com.viettel.core.bussiness.report;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.viettel.core.dao.service.SmsServiceGroupDAO;
import com.viettel.core.entities.service.SmsServiceGroup;
import com.viettel.core.exceptions.BusinessException;
import com.viettel.core.exceptions.DataAccessException;

/**
 *  @author: HUYNHDC
 *  @version:  
 *  @since: 17/07/2014 - 10:50:59
 */
public class SmsServiceGroupMgrImpl implements SmsServiceGroupMgr {

	@Autowired
	SmsServiceGroupDAO smsServiceGroupDAO;
	
	@Override
	public SmsServiceGroup getSmsServiceGroupById(Integer id)
			throws BusinessException {
		try { 
			return  smsServiceGroupDAO.getSmsServiceGroupById(id); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}

	@Override
	public SmsServiceGroup createSmsServiceGroup(SmsServiceGroup smsServiceGroup)
			throws BusinessException {
		try { 
			return  smsServiceGroupDAO.createSmsServiceGroup(smsServiceGroup); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}

	@Override
	public List<SmsServiceGroup> getAllSmsServiceGroup()
			throws BusinessException {
		try { 
			return  smsServiceGroupDAO.getAllSmsServiceGroup(); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}

	@Override
	public void updateSmsServiceGroup(SmsServiceGroup smsServiceGroup)
			throws BusinessException {
		try { 
			smsServiceGroupDAO.updateSmsServiceGroup(smsServiceGroup); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}

	@Override
	public void deleteSmsServiceGroup(SmsServiceGroup smsServiceGroup)
			throws BusinessException {
		try { 
			smsServiceGroupDAO.deleteSmsServiceGroup(smsServiceGroup); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}

}
